package com.ruoyi.order.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ruoyi.order.domain.OrderPromotion;
import com.ruoyi.order.mapper.OrderPromotionMapper;
import com.ruoyi.order.service.IOrderPromotionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 支付优惠Service业务层处理
 *
 * @author HHAOYU
 * @date 2020-12-14
 */
@Service
public class OrderPromotionServiceImpl extends ServiceImpl<OrderPromotionMapper, OrderPromotion> implements IOrderPromotionService {
    @Autowired
    private OrderPromotionMapper orderPromotionMapper;

    /**
     * 查询支付优惠
     *
     * @param id 支付优惠ID
     * @return 支付优惠
     */
    @Override
    public OrderPromotion selectOrderPromotionById(Long id)
    {
        return orderPromotionMapper.selectOrderPromotionById(id);
    }

    /**
     * 查询支付优惠列表
     *
     * @param orderPromotion 支付优惠
     * @return 支付优惠
     */
    @Override
    public List<OrderPromotion> selectOrderPromotionList(OrderPromotion orderPromotion)
    {
        return orderPromotionMapper.selectOrderPromotionList(orderPromotion);
    }

    /**
     * 新增支付优惠
     *
     * @param orderPromotion 支付优惠
     * @return 结果
     */
    @Override
    public int insertOrderPromotion(OrderPromotion orderPromotion)
    {
        return orderPromotionMapper.insertOrderPromotion(orderPromotion);
    }

    /**
     * 修改支付优惠
     *
     * @param orderPromotion 支付优惠
     * @return 结果
     */
    @Override
    public int updateOrderPromotion(OrderPromotion orderPromotion)
    {
        return orderPromotionMapper.updateOrderPromotion(orderPromotion);
    }

    /**
     * 批量删除支付优惠
     *
     * @param ids 需要删除的支付优惠ID
     * @return 结果
     */
    @Override
    public int deleteOrderPromotionByIds(Long[] ids)
    {
        return orderPromotionMapper.deleteOrderPromotionByIds(ids);
    }

    /**
     * 删除支付优惠信息
     *
     * @param id 支付优惠ID
     * @return 结果
     */
    @Override
    public int deleteOrderPromotionById(Long id)
    {
        return orderPromotionMapper.deleteOrderPromotionById(id);
    }
}
